import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_connect/http/src/utils/utils.dart';
import 'package:search_people/value/topcolors.dart';

class MoreDataHeader extends StatelessWidget {
  const MoreDataHeader({
    Key? key,
    required this.title,
    this.onTap,
  }) : super(key: key);
  final String title;
  final Function()? onTap;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 40.r,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          border: Border(bottom: BorderSide(color: TopColors.bg)),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              title,
              style: TextStyle(
                color: TopColors.black_33,
                fontSize: 15.sp,
                fontWeight: FontWeight.bold,
              ),
            ),
            Row(
              children: [
                Text(
                  '更多',
                  style: TextStyle(color: TopColors.black_33, fontSize: 13.sp),
                ),
                Icon(
                  Icons.chevron_right_rounded,
                  color: TopColors.black_33,
                ),
              ],
            )
          ],
        ),
      ),
    );
  }
}

class MoreDataFooter extends StatelessWidget {
  const MoreDataFooter({
    Key? key,
    required this.isExpend,
    this.onTap,
  }) : super(key: key);
  final bool isExpend;
  final Function()? onTap;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 40.r,
        alignment: Alignment.center,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              isExpend ? '收起更多' : '展开更多',
              style: TextStyle(color: TopColors.black_33, fontSize: 13.sp),
            ),
            Icon(
              isExpend ? Icons.arrow_drop_up : Icons.arrow_drop_down,
              color: TopColors.black_33,
            ),
          ],
        ),
      ),
    );
  }
}
